var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var imagemin = require('gulp-imagemin');
var concat = require('gulp-concat');
var minifyHTML = require('gulp-htmlmin');
var del = require('del');
console.log('执行了');
gulp.task('minifyHTML', function () {
    gulp.src('dist/*.html')
        .pipe(minifyHTML({collapseWhitespace: true}))
        .pipe(gulp.dest('gulpDist'));
});
gulp.task('script', function () {
    gulp.src('dist/*.js')
        .pipe(uglify())
        .pipe(gulp.dest('gulpDist'))
});
gulp.task('css', function () {
    gulp.src('dist/*.css')
        .pipe(minifyCSS())
        .pipe(gulp.dest('gulpDist'));
});
gulp.task('images1', function () {
    gulp.src('dist/assets/*.*')
        .pipe(imagemin({
            progressive: true
        }))
        .pipe(gulp.dest('gulpDist/assets'));
});
gulp.task('images2', function () {
    gulp.src('dist/*.*')
        .pipe(imagemin({
            progressive: true
        }))
        .pipe(gulp.dest('gulpDist'));
});
gulp.task('clean', function (cb) {
    del([
        'gulpDist/*'
    ], cb);
});
gulp.task('default', ['clean', 'minifyHTML', 'script', 'css', 'images1', 'images2']);